home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / bash_completion.d / minicom < prev    next >
Encoding:
Text File  |  2010-11-16  |  1.3 KB  |  54 lines

  1. # bash completion for minicom
  2.  
  3. have minicom &&
  4. _minicom()
  5. {
  6.     local cur prev confdir
  7.  
  8.     COMPREPLY=()
  9.     _get_comp_words_by_ref cur prev
  10.  
  11.     case $prev in
  12.         -a|-c)
  13.             COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
  14.             return 0
  15.             ;;
  16.         -S|-C)
  17.             _filedir
  18.             return 0
  19.             ;;
  20.         -P)
  21.             COMPREPLY=( $( printf '%s\n' /dev/tty* ) )
  22.             COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' \
  23.                 -- "$cur" ) )
  24.             return 0
  25.             ;;
  26.     esac
  27.  
  28.  
  29.     if [[ "$cur" == -* ]]; then
  30.         COMPREPLY=( $( compgen -W '-s -o -m -M -z -l -L -w -a -t \
  31.             -c -S -d -p -C -T -7 -8' -- "$cur" ) )
  32.         return 0
  33.     else
  34.         [ -n "$( command ls /etc/minirc.* 2>/dev/null)" ] \
  35.             && confdir=/etc
  36.         [ -n "$( command ls /etc/minicom/minirc.* 2>/dev/null)" ] \
  37.             && confdir=/etc/minicom
  38.         if [ -n "$confdir" ]; then
  39.             COMPREPLY=( $( compgen -W '$( printf "%s\n" $confdir/minirc.* | \
  40.                 sed -e "s|$confdir/minirc.||")' -- "$cur" ) )
  41.             return 0
  42.         fi
  43.     fi
  44. } &&
  45. complete -F _minicom -o default minicom
  46.  
  47. # Local variables:
  48. # mode: shell-script
  49. # sh-basic-offset: 4
  50. # sh-indent-comment: t
  51. # indent-tabs-mode: nil
  52. # End:
  53. # ex: ts=4 sw=4 et filetype=sh
  54.